var _contract = null;
function setPrintData(contract) {
  _contract = contract;
  _prt.setPageSize(210, 297);
  _prt.setMargin(15,15,15,15);
  _prt.setLineHeight(5);
  _prt.setPageFoot(" {pg}/1                                        电子合同校验码："+contract.printVerifyCode);

  _prt.add(["sf", "12pt 黑体"]);
  _prt.add(["dt", "Deposit Form 定金合约", 140, 15 + 7]);
  _prt.add(["sp", 0, 0]);
  _prt.add(["pi", "/images/logo.png", 50, 10]);
  _prt.add(["pl"]);

  _prt.add(["sf", "9pt 宋体"]);
  _prt.add(["nt", "Home Club 专属会所："+contract.shopName, 0.5]);
  _prt.add(["nt", "Membership NO. 会员编号："+contract.memberCode, 0.5]);
  _prt.add(["nt", "Membership Consultant 会籍顾问："+contract.salesName+" "+contract.salesName2, 0.5]);
  _prt.add(["nt", "Membership Card 会员卡号："+contract.cardCode, 0.5]);
  _prt.add(["nl", 1]);
  _prt.add(["pl"]);
  _prt.add(["pt", "Name 姓名："+contract.memberName]);
  _prt.add(["pt", "ID/Passport NO.身份证/护照号码："+contract.idNumber]);
  _prt.add(["nt", "Mobile 手机："+contract.mobile, 0.5]);
  _prt.add(["nt", "Sex 性别："+contract.gender, 0.5]);
  _prt.add(["nt", "Deposit Type 定金类型："+contract.earnestTypeName, 0.5]);
  _prt.add(["nt", "Received 已收金额："+contract.payAmount+"元", 0.5]);
  _prt.add(["nl", 1]);
  _prt.add(["pt", "Effective Date 定金生效日期："+contract.saleDate]);
  _prt.add(["pt", "Expiry Date    定金终止日期："+contract.overDueDate]);
  _prt.add(["nl", 1]);
  _prt.add(["pt", "I understand and agree to the starting date. Please provide your signature."]);
  _prt.add(["pt", "我明白及同意以此日期生效签署"]);
  _prt.add(["pl"]);

  _prt.add(["sf", "12pt 黑体"]);
  _prt.add(["pt", "Club Rules 会员章程"]);
  _prt.add(["nl", 0.2]);
  _prt.add(["sf", "9pt 宋体"]);

  _prt.add(["pt", "所有已缴纳之款项不得用于垫付任何其他费用。There’s no refund or transfer for all the already-made payment. "]);
  _prt.add(["pt", ""]);

  _prt.add(["pt", "如果会员知悉或应知悉自己可能因某些原因，而无法使用威康健身管理咨询（上海）有限公司全部设施之情况下，会员同意可因此接受有限度之训练，因此不论会员之使用次数或项目，"]);
  _prt.add(["pt", "仍需缴付全部所需费用。 "]);
  _prt.add(["pt", ""]);
  _prt.add(["pt", "If the member knows or should know he has a problem that might prevent him from using all Welcom Fitness Management(Shanghai) Limited facilities and he signs this agreement, he agrees that his training is limited accordingly. However because this is his choice he must still pay the fees as if he could use all the facilities."]);
  _prt.add(["pt", ""]);

  _prt.add(["pt", "I have read,understood and accepted the rules and regulations f the club at the back of this application form."]);
  _prt.add(["pt", "本人已经阅读并同意遵守此申请表之会所守则及规条。"]);

  _prt.add(["nl", 1]);
  _prt.add(["nt", "Member Signatre 会员签名：", 0.5]);
  if(contract.memberSign) {
    _prt.add(["my", -4]);
    _prt.add(["pi", contract.memberSign, 25, 8]);
  } else {
    _prt.add(["nl", 1]);
  }
  _prt.add(["pt", "Date 日期："+contract.saleDate]);

  _prt.add(["nl", 2]);
  _prt.add(["sf", "12pt 黑体"]);
  _prt.add(["nt", contract.companyName, 0.5]);
  _prt.add(["my", -13]);
  _prt.add(["mx", -20]);
  if(contract.sealPic) _prt.add(["pi", contract.sealPic, 39, 39]);
  _prt.add(["sf", "9pt 宋体"]);

  _prt.add(["nl", 5]);
  _prt.add(["pt", "合同打印日期: "+contract.printDate]);
  _prt.add(["pt", "合同打印人: "+contract.printUserName]);
  _prt.add(["pt", "合同打印门店: "+contract.printShopName]);
}

function printOk() {
  if(_contract) {
    getJson("_print?saleId="+_contract.saleId+"&contractType=03", function(data){
      if(data.ret) cload();
    });
  }
}